(0) Obligation:

Clauses:

star(U, []) :- !.
star([], W) :- ','(!, =(W, [])).
star(U, W) :- ','(app(U, V, W), star(U, V)).
app([], L, L).
app(.(X, L), M, .(X, N)) :- app(L, M, N).
=(X, X).

Query: star(g,g)

(1) BuiltinConflictTransformerProof (EQUIVALENT transformation)

Renamed defined predicates conflicting with built-in predicates [PROLOG].

(2) Obligation:

Clauses:

star(U, []) :- !.
star([], W) :- ','(!, user_defined_=(W, [])).
star(U, W) :- ','(app(U, V, W), star(U, V)).
app([], L, L).
app(.(X, L), M, .(X, N)) :- app(L, M, N).
user_defined_=(X, X).

Query: star(g,g)

(3) PrologToPrologProblemTransformerProof (SOUND transformation)

Built Prolog problem from termination graph ICLP10.

(4) Obligation:

Clauses:

appA([], T31, T31).
appA(.(T38, T39), X60, .(T38, T40)) :- appA(T39, X60, T40).
starB(T4, []).
starB(.(T19, T20), .(T19, T21)) :- appA(T20, X27, T21).
starB(.(T19, T20), .(T19, T21)) :- ','(appA(T20, T24, T21), starB(.(T19, T20), T24)).

Query: starB(g,g)

(5) PrologToPiTRSProof (SOUND transformation)

We use the technique of [TOCL09]. With regard to the inferred argument filtering the predicates were used in the following modes:
starB_in: (b,b)
appA_in: (b,f,b)
Transforming Prolog into the following Term Rewriting System:
Pi-finite rewrite system:
The TRS R consists of the following rules:

starB_in_gg(T4, []) → starB_out_gg(T4, [])
starB_in_gg(.(T19, T20), .(T19, T21)) → U2_gg(T19, T20, T21, appA_in_gag(T20, X27, T21))
appA_in_gag([], T31, T31) → appA_out_gag([], T31, T31)
appA_in_gag(.(T38, T39), X60, .(T38, T40)) → U1_gag(T38, T39, X60, T40, appA_in_gag(T39, X60, T40))
U1_gag(T38, T39, X60, T40, appA_out_gag(T39, X60, T40)) → appA_out_gag(.(T38, T39), X60, .(T38, T40))
U2_gg(T19, T20, T21, appA_out_gag(T20, X27, T21)) → starB_out_gg(.(T19, T20), .(T19, T21))
starB_in_gg(.(T19, T20), .(T19, T21)) → U3_gg(T19, T20, T21, appA_in_gag(T20, T24, T21))
U3_gg(T19, T20, T21, appA_out_gag(T20, T24, T21)) → U4_gg(T19, T20, T21, starB_in_gg(.(T19, T20), T24))
U4_gg(T19, T20, T21, starB_out_gg(.(T19, T20), T24)) → starB_out_gg(.(T19, T20), .(T19, T21))

The argument filtering Pi contains the following mapping:
starB_in_gg(x1, x2)  =  starB_in_gg(x1, x2)
[]  =  []
starB_out_gg(x1, x2)  =  starB_out_gg
.(x1, x2)  =  .(x1, x2)
U2_gg(x1, x2, x3, x4)  =  U2_gg(x4)
appA_in_gag(x1, x2, x3)  =  appA_in_gag(x1, x3)
appA_out_gag(x1, x2, x3)  =  appA_out_gag(x2)
U1_gag(x1, x2, x3, x4, x5)  =  U1_gag(x5)
U3_gg(x1, x2, x3, x4)  =  U3_gg(x1, x2, x4)
U4_gg(x1, x2, x3, x4)  =  U4_gg(x4)

Infinitary Constructor Rewriting Termination of PiTRS implies Termination of Prolog

(6) Obligation:

Pi-finite rewrite system:
The TRS R consists of the following rules:

starB_in_gg(T4, []) → starB_out_gg(T4, [])
starB_in_gg(.(T19, T20), .(T19, T21)) → U2_gg(T19, T20, T21, appA_in_gag(T20, X27, T21))
appA_in_gag([], T31, T31) → appA_out_gag([], T31, T31)
appA_in_gag(.(T38, T39), X60, .(T38, T40)) → U1_gag(T38, T39, X60, T40, appA_in_gag(T39, X60, T40))
U1_gag(T38, T39, X60, T40, appA_out_gag(T39, X60, T40)) → appA_out_gag(.(T38, T39), X60, .(T38, T40))
U2_gg(T19, T20, T21, appA_out_gag(T20, X27, T21)) → starB_out_gg(.(T19, T20), .(T19, T21))
starB_in_gg(.(T19, T20), .(T19, T21)) → U3_gg(T19, T20, T21, appA_in_gag(T20, T24, T21))
U3_gg(T19, T20, T21, appA_out_gag(T20, T24, T21)) → U4_gg(T19, T20, T21, starB_in_gg(.(T19, T20), T24))
U4_gg(T19, T20, T21, starB_out_gg(.(T19, T20), T24)) → starB_out_gg(.(T19, T20), .(T19, T21))

The argument filtering Pi contains the following mapping:
starB_in_gg(x1, x2)  =  starB_in_gg(x1, x2)
[]  =  []
starB_out_gg(x1, x2)  =  starB_out_gg
.(x1, x2)  =  .(x1, x2)
U2_gg(x1, x2, x3, x4)  =  U2_gg(x4)
appA_in_gag(x1, x2, x3)  =  appA_in_gag(x1, x3)
appA_out_gag(x1, x2, x3)  =  appA_out_gag(x2)
U1_gag(x1, x2, x3, x4, x5)  =  U1_gag(x5)
U3_gg(x1, x2, x3, x4)  =  U3_gg(x1, x2, x4)
U4_gg(x1, x2, x3, x4)  =  U4_gg(x4)

(7) DependencyPairsProof (EQUIVALENT transformation)

Using Dependency Pairs [AG00,LOPSTR] we result in the following initial DP problem:
Pi DP problem:
The TRS P consists of the following rules:

STARB_IN_GG(.(T19, T20), .(T19, T21)) → U2_GG(T19, T20, T21, appA_in_gag(T20, X27, T21))
STARB_IN_GG(.(T19, T20), .(T19, T21)) → APPA_IN_GAG(T20, X27, T21)
APPA_IN_GAG(.(T38, T39), X60, .(T38, T40)) → U1_GAG(T38, T39, X60, T40, appA_in_gag(T39, X60, T40))
APPA_IN_GAG(.(T38, T39), X60, .(T38, T40)) → APPA_IN_GAG(T39, X60, T40)
STARB_IN_GG(.(T19, T20), .(T19, T21)) → U3_GG(T19, T20, T21, appA_in_gag(T20, T24, T21))
U3_GG(T19, T20, T21, appA_out_gag(T20, T24, T21)) → U4_GG(T19, T20, T21, starB_in_gg(.(T19, T20), T24))
U3_GG(T19, T20, T21, appA_out_gag(T20, T24, T21)) → STARB_IN_GG(.(T19, T20), T24)

The TRS R consists of the following rules:

starB_in_gg(T4, []) → starB_out_gg(T4, [])
starB_in_gg(.(T19, T20), .(T19, T21)) → U2_gg(T19, T20, T21, appA_in_gag(T20, X27, T21))
appA_in_gag([], T31, T31) → appA_out_gag([], T31, T31)
appA_in_gag(.(T38, T39), X60, .(T38, T40)) → U1_gag(T38, T39, X60, T40, appA_in_gag(T39, X60, T40))
U1_gag(T38, T39, X60, T40, appA_out_gag(T39, X60, T40)) → appA_out_gag(.(T38, T39), X60, .(T38, T40))
U2_gg(T19, T20, T21, appA_out_gag(T20, X27, T21)) → starB_out_gg(.(T19, T20), .(T19, T21))
starB_in_gg(.(T19, T20), .(T19, T21)) → U3_gg(T19, T20, T21, appA_in_gag(T20, T24, T21))
U3_gg(T19, T20, T21, appA_out_gag(T20, T24, T21)) → U4_gg(T19, T20, T21, starB_in_gg(.(T19, T20), T24))
U4_gg(T19, T20, T21, starB_out_gg(.(T19, T20), T24)) → starB_out_gg(.(T19, T20), .(T19, T21))

The argument filtering Pi contains the following mapping:
starB_in_gg(x1, x2)  =  starB_in_gg(x1, x2)
[]  =  []
starB_out_gg(x1, x2)  =  starB_out_gg
.(x1, x2)  =  .(x1, x2)
U2_gg(x1, x2, x3, x4)  =  U2_gg(x4)
appA_in_gag(x1, x2, x3)  =  appA_in_gag(x1, x3)
appA_out_gag(x1, x2, x3)  =  appA_out_gag(x2)
U1_gag(x1, x2, x3, x4, x5)  =  U1_gag(x5)
U3_gg(x1, x2, x3, x4)  =  U3_gg(x1, x2, x4)
U4_gg(x1, x2, x3, x4)  =  U4_gg(x4)
STARB_IN_GG(x1, x2)  =  STARB_IN_GG(x1, x2)
U2_GG(x1, x2, x3, x4)  =  U2_GG(x4)
APPA_IN_GAG(x1, x2, x3)  =  APPA_IN_GAG(x1, x3)
U1_GAG(x1, x2, x3, x4, x5)  =  U1_GAG(x5)
U3_GG(x1, x2, x3, x4)  =  U3_GG(x1, x2, x4)
U4_GG(x1, x2, x3, x4)  =  U4_GG(x4)

We have to consider all (P,R,Pi)-chains

(8) Obligation:

Pi DP problem:
The TRS P consists of the following rules:

STARB_IN_GG(.(T19, T20), .(T19, T21)) → U2_GG(T19, T20, T21, appA_in_gag(T20, X27, T21))
STARB_IN_GG(.(T19, T20), .(T19, T21)) → APPA_IN_GAG(T20, X27, T21)
APPA_IN_GAG(.(T38, T39), X60, .(T38, T40)) → U1_GAG(T38, T39, X60, T40, appA_in_gag(T39, X60, T40))
APPA_IN_GAG(.(T38, T39), X60, .(T38, T40)) → APPA_IN_GAG(T39, X60, T40)
STARB_IN_GG(.(T19, T20), .(T19, T21)) → U3_GG(T19, T20, T21, appA_in_gag(T20, T24, T21))
U3_GG(T19, T20, T21, appA_out_gag(T20, T24, T21)) → U4_GG(T19, T20, T21, starB_in_gg(.(T19, T20), T24))
U3_GG(T19, T20, T21, appA_out_gag(T20, T24, T21)) → STARB_IN_GG(.(T19, T20), T24)

The TRS R consists of the following rules:

starB_in_gg(T4, []) → starB_out_gg(T4, [])
starB_in_gg(.(T19, T20), .(T19, T21)) → U2_gg(T19, T20, T21, appA_in_gag(T20, X27, T21))
appA_in_gag([], T31, T31) → appA_out_gag([], T31, T31)
appA_in_gag(.(T38, T39), X60, .(T38, T40)) → U1_gag(T38, T39, X60, T40, appA_in_gag(T39, X60, T40))
U1_gag(T38, T39, X60, T40, appA_out_gag(T39, X60, T40)) → appA_out_gag(.(T38, T39), X60, .(T38, T40))
U2_gg(T19, T20, T21, appA_out_gag(T20, X27, T21)) → starB_out_gg(.(T19, T20), .(T19, T21))
starB_in_gg(.(T19, T20), .(T19, T21)) → U3_gg(T19, T20, T21, appA_in_gag(T20, T24, T21))
U3_gg(T19, T20, T21, appA_out_gag(T20, T24, T21)) → U4_gg(T19, T20, T21, starB_in_gg(.(T19, T20), T24))
U4_gg(T19, T20, T21, starB_out_gg(.(T19, T20), T24)) → starB_out_gg(.(T19, T20), .(T19, T21))

The argument filtering Pi contains the following mapping:
starB_in_gg(x1, x2)  =  starB_in_gg(x1, x2)
[]  =  []
starB_out_gg(x1, x2)  =  starB_out_gg
.(x1, x2)  =  .(x1, x2)
U2_gg(x1, x2, x3, x4)  =  U2_gg(x4)
appA_in_gag(x1, x2, x3)  =  appA_in_gag(x1, x3)
appA_out_gag(x1, x2, x3)  =  appA_out_gag(x2)
U1_gag(x1, x2, x3, x4, x5)  =  U1_gag(x5)
U3_gg(x1, x2, x3, x4)  =  U3_gg(x1, x2, x4)
U4_gg(x1, x2, x3, x4)  =  U4_gg(x4)
STARB_IN_GG(x1, x2)  =  STARB_IN_GG(x1, x2)
U2_GG(x1, x2, x3, x4)  =  U2_GG(x4)
APPA_IN_GAG(x1, x2, x3)  =  APPA_IN_GAG(x1, x3)
U1_GAG(x1, x2, x3, x4, x5)  =  U1_GAG(x5)
U3_GG(x1, x2, x3, x4)  =  U3_GG(x1, x2, x4)
U4_GG(x1, x2, x3, x4)  =  U4_GG(x4)

We have to consider all (P,R,Pi)-chains

(9) DependencyGraphProof (EQUIVALENT transformation)

The approximation of the Dependency Graph [LOPSTR] contains 2 SCCs with 4 less nodes.

(10) Complex Obligation (AND)

(11) Obligation:

Pi DP problem:
The TRS P consists of the following rules:

APPA_IN_GAG(.(T38, T39), X60, .(T38, T40)) → APPA_IN_GAG(T39, X60, T40)

The TRS R consists of the following rules:

starB_in_gg(T4, []) → starB_out_gg(T4, [])
starB_in_gg(.(T19, T20), .(T19, T21)) → U2_gg(T19, T20, T21, appA_in_gag(T20, X27, T21))
appA_in_gag([], T31, T31) → appA_out_gag([], T31, T31)
appA_in_gag(.(T38, T39), X60, .(T38, T40)) → U1_gag(T38, T39, X60, T40, appA_in_gag(T39, X60, T40))
U1_gag(T38, T39, X60, T40, appA_out_gag(T39, X60, T40)) → appA_out_gag(.(T38, T39), X60, .(T38, T40))
U2_gg(T19, T20, T21, appA_out_gag(T20, X27, T21)) → starB_out_gg(.(T19, T20), .(T19, T21))
starB_in_gg(.(T19, T20), .(T19, T21)) → U3_gg(T19, T20, T21, appA_in_gag(T20, T24, T21))
U3_gg(T19, T20, T21, appA_out_gag(T20, T24, T21)) → U4_gg(T19, T20, T21, starB_in_gg(.(T19, T20), T24))
U4_gg(T19, T20, T21, starB_out_gg(.(T19, T20), T24)) → starB_out_gg(.(T19, T20), .(T19, T21))

The argument filtering Pi contains the following mapping:
starB_in_gg(x1, x2)  =  starB_in_gg(x1, x2)
[]  =  []
starB_out_gg(x1, x2)  =  starB_out_gg
.(x1, x2)  =  .(x1, x2)
U2_gg(x1, x2, x3, x4)  =  U2_gg(x4)
appA_in_gag(x1, x2, x3)  =  appA_in_gag(x1, x3)
appA_out_gag(x1, x2, x3)  =  appA_out_gag(x2)
U1_gag(x1, x2, x3, x4, x5)  =  U1_gag(x5)
U3_gg(x1, x2, x3, x4)  =  U3_gg(x1, x2, x4)
U4_gg(x1, x2, x3, x4)  =  U4_gg(x4)
APPA_IN_GAG(x1, x2, x3)  =  APPA_IN_GAG(x1, x3)

We have to consider all (P,R,Pi)-chains

(12) UsableRulesProof (EQUIVALENT transformation)

For (infinitary) constructor rewriting [LOPSTR] we can delete all non-usable rules from R.

(13) Obligation:

Pi DP problem:
The TRS P consists of the following rules:

APPA_IN_GAG(.(T38, T39), X60, .(T38, T40)) → APPA_IN_GAG(T39, X60, T40)

R is empty.
The argument filtering Pi contains the following mapping:
.(x1, x2)  =  .(x1, x2)
APPA_IN_GAG(x1, x2, x3)  =  APPA_IN_GAG(x1, x3)

We have to consider all (P,R,Pi)-chains

(14) PiDPToQDPProof (SOUND transformation)

Transforming (infinitary) constructor rewriting Pi-DP problem [LOPSTR] into ordinary QDP problem [LPAR04] by application of Pi.

(15) Obligation:

Q DP problem:
The TRS P consists of the following rules:

APPA_IN_GAG(.(T38, T39), .(T38, T40)) → APPA_IN_GAG(T39, T40)

R is empty.
Q is empty.
We have to consider all (P,Q,R)-chains.

(16) QDPSizeChangeProof (EQUIVALENT transformation)

By using the subterm criterion [SUBTERM_CRITERION] together with the size-change analysis [AAECC05] we have proven that there are no infinite chains for this DP problem.

From the DPs we obtained the following set of size-change graphs:

  • APPA_IN_GAG(.(T38, T39), .(T38, T40)) → APPA_IN_GAG(T39, T40)
    The graph contains the following edges 1 > 1, 2 > 2

(17) YES

(18) Obligation:

Pi DP problem:
The TRS P consists of the following rules:

STARB_IN_GG(.(T19, T20), .(T19, T21)) → U3_GG(T19, T20, T21, appA_in_gag(T20, T24, T21))
U3_GG(T19, T20, T21, appA_out_gag(T20, T24, T21)) → STARB_IN_GG(.(T19, T20), T24)

The TRS R consists of the following rules:

starB_in_gg(T4, []) → starB_out_gg(T4, [])
starB_in_gg(.(T19, T20), .(T19, T21)) → U2_gg(T19, T20, T21, appA_in_gag(T20, X27, T21))
appA_in_gag([], T31, T31) → appA_out_gag([], T31, T31)
appA_in_gag(.(T38, T39), X60, .(T38, T40)) → U1_gag(T38, T39, X60, T40, appA_in_gag(T39, X60, T40))
U1_gag(T38, T39, X60, T40, appA_out_gag(T39, X60, T40)) → appA_out_gag(.(T38, T39), X60, .(T38, T40))
U2_gg(T19, T20, T21, appA_out_gag(T20, X27, T21)) → starB_out_gg(.(T19, T20), .(T19, T21))
starB_in_gg(.(T19, T20), .(T19, T21)) → U3_gg(T19, T20, T21, appA_in_gag(T20, T24, T21))
U3_gg(T19, T20, T21, appA_out_gag(T20, T24, T21)) → U4_gg(T19, T20, T21, starB_in_gg(.(T19, T20), T24))
U4_gg(T19, T20, T21, starB_out_gg(.(T19, T20), T24)) → starB_out_gg(.(T19, T20), .(T19, T21))

The argument filtering Pi contains the following mapping:
starB_in_gg(x1, x2)  =  starB_in_gg(x1, x2)
[]  =  []
starB_out_gg(x1, x2)  =  starB_out_gg
.(x1, x2)  =  .(x1, x2)
U2_gg(x1, x2, x3, x4)  =  U2_gg(x4)
appA_in_gag(x1, x2, x3)  =  appA_in_gag(x1, x3)
appA_out_gag(x1, x2, x3)  =  appA_out_gag(x2)
U1_gag(x1, x2, x3, x4, x5)  =  U1_gag(x5)
U3_gg(x1, x2, x3, x4)  =  U3_gg(x1, x2, x4)
U4_gg(x1, x2, x3, x4)  =  U4_gg(x4)
STARB_IN_GG(x1, x2)  =  STARB_IN_GG(x1, x2)
U3_GG(x1, x2, x3, x4)  =  U3_GG(x1, x2, x4)

We have to consider all (P,R,Pi)-chains

(19) UsableRulesProof (EQUIVALENT transformation)

For (infinitary) constructor rewriting [LOPSTR] we can delete all non-usable rules from R.

(20) Obligation:

Pi DP problem:
The TRS P consists of the following rules:

STARB_IN_GG(.(T19, T20), .(T19, T21)) → U3_GG(T19, T20, T21, appA_in_gag(T20, T24, T21))
U3_GG(T19, T20, T21, appA_out_gag(T20, T24, T21)) → STARB_IN_GG(.(T19, T20), T24)

The TRS R consists of the following rules:

appA_in_gag([], T31, T31) → appA_out_gag([], T31, T31)
appA_in_gag(.(T38, T39), X60, .(T38, T40)) → U1_gag(T38, T39, X60, T40, appA_in_gag(T39, X60, T40))
U1_gag(T38, T39, X60, T40, appA_out_gag(T39, X60, T40)) → appA_out_gag(.(T38, T39), X60, .(T38, T40))

The argument filtering Pi contains the following mapping:
[]  =  []
.(x1, x2)  =  .(x1, x2)
appA_in_gag(x1, x2, x3)  =  appA_in_gag(x1, x3)
appA_out_gag(x1, x2, x3)  =  appA_out_gag(x2)
U1_gag(x1, x2, x3, x4, x5)  =  U1_gag(x5)
STARB_IN_GG(x1, x2)  =  STARB_IN_GG(x1, x2)
U3_GG(x1, x2, x3, x4)  =  U3_GG(x1, x2, x4)

We have to consider all (P,R,Pi)-chains

(21) PiDPToQDPProof (SOUND transformation)

Transforming (infinitary) constructor rewriting Pi-DP problem [LOPSTR] into ordinary QDP problem [LPAR04] by application of Pi.

(22) Obligation:

Q DP problem:
The TRS P consists of the following rules:

STARB_IN_GG(.(T19, T20), .(T19, T21)) → U3_GG(T19, T20, appA_in_gag(T20, T21))
U3_GG(T19, T20, appA_out_gag(T24)) → STARB_IN_GG(.(T19, T20), T24)

The TRS R consists of the following rules:

appA_in_gag([], T31) → appA_out_gag(T31)
appA_in_gag(.(T38, T39), .(T38, T40)) → U1_gag(appA_in_gag(T39, T40))
U1_gag(appA_out_gag(X60)) → appA_out_gag(X60)

The set Q consists of the following terms:

appA_in_gag(x0, x1)
U1_gag(x0)

We have to consider all (P,Q,R)-chains.

(23) QDPOrderProof (EQUIVALENT transformation)

We use the reduction pair processor [LPAR04,JAR06].


The following pairs can be oriented strictly and are deleted.


STARB_IN_GG(.(T19, T20), .(T19, T21)) → U3_GG(T19, T20, appA_in_gag(T20, T21))
The remaining pairs can at least be oriented weakly.
Used ordering: Polynomial interpretation [POLO]:

POL(.(x1, x2)) = 1 + x2   
POL(STARB_IN_GG(x1, x2)) = x2   
POL(U1_gag(x1)) = x1   
POL(U3_GG(x1, x2, x3)) = x3   
POL([]) = 0   
POL(appA_in_gag(x1, x2)) = x2   
POL(appA_out_gag(x1)) = x1   

The following usable rules [FROCOS05] with respect to the argument filtering of the ordering [JAR06] were oriented:

appA_in_gag([], T31) → appA_out_gag(T31)
appA_in_gag(.(T38, T39), .(T38, T40)) → U1_gag(appA_in_gag(T39, T40))
U1_gag(appA_out_gag(X60)) → appA_out_gag(X60)

(24) Obligation:

Q DP problem:
The TRS P consists of the following rules:

U3_GG(T19, T20, appA_out_gag(T24)) → STARB_IN_GG(.(T19, T20), T24)

The TRS R consists of the following rules:

appA_in_gag([], T31) → appA_out_gag(T31)
appA_in_gag(.(T38, T39), .(T38, T40)) → U1_gag(appA_in_gag(T39, T40))
U1_gag(appA_out_gag(X60)) → appA_out_gag(X60)

The set Q consists of the following terms:

appA_in_gag(x0, x1)
U1_gag(x0)

We have to consider all (P,Q,R)-chains.

(25) DependencyGraphProof (EQUIVALENT transformation)

The approximation of the Dependency Graph [LPAR04,FROCOS05,EDGSTAR] contains 0 SCCs with 1 less node.

(26) TRUE